package NewSiteAXL;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.util.ArrayList;

import javax.swing.JCheckBox;

import utils.BasePanel;
import utils.lignOptions;
import utils.xMLGear;
import utils.xMLReader;

import Window.Fenetre;

public class CollecteSiteAXL extends BasePanel
	{
	/************
	 * Variables
	 ************/
	CollecteSiteProcessAXL maCollecteSite;
	public Fenetre maFenetre;
	public ArrayList<lignOptions> optionList;
	String[] tabOption;
	JCheckBox selectAll;
	
	/****************
	 * Constructeurs
	 ****************/
	public CollecteSiteAXL(Fenetre maFenetre)
		{
		/**
		 * Variables
		 */
		this.maFenetre = maFenetre;
		optionList = new ArrayList<lignOptions>();
		selectAll = new JCheckBox("Check all");
		
		/***********************
		 * Option definition
		 */
		tabOption = new String[]{"location","region","srstreference","devicepool","conferencebridge","mediaressourcegroup","mediaressourcegrouplist","gateway","vg","routegroup","commondeviceconfiguration","partitions","callingsearchspaces","routelist","TranslationPattern","calledpartytranspattern","callingpartytranspattern"};
		utils.variable.setOptions(new boolean[tabOption.length]);
		
		choixOptions.setLayout(new FlowLayout());
		choixOptions.setPreferredSize(new Dimension(maFenetre.getWidth(),tabOption.length*8));
		
		for(int i=0;i<tabOption.length;i++)
			{
			optionList.add(new lignOptions(tabOption[i]));
			}
		
		for(int i=0;i<optionList.size();i++)
			{
			choixOptions.add(optionList.get(i));
			}
		//Selection of all Options Check box
		optionSelectAll(true);
		selectAll.setSelected(true);
		/**********************/
		
		Vccm.setVisible(false);
		Cversion.setVisible(false);
		panneau.add(selectAll);
		
		//Events
		maCollecteSite = new CollecteSiteProcessAXL(this);
		launch.addActionListener(maCollecteSite);
		selectAll.addActionListener(maCollecteSite);
		}
	
	/****************************************
	 * Method used to select or deselect all
	 * the options check box 
	 ****************************************/
	public void optionSelectAll(boolean bool)
		{
		for(int i=0;i<optionList.size();i++)
			{
			optionList.get(i).getBobox().setSelected(bool);
			}
		}
	
	/*2012*//*RATEL Alexandre 8)*/
	}
